#!/bin/sh

# Demostration script to initialize the virtual machines system
# EEPROM.

. /etc/machine.conf

echo "Initializing ONIE system EEPROM..."
onie-syseeprom -e

# parse build date
year=${onie_build_date%%-*}
rest=${onie_build_date#*-}
month=${rest%%-*}
rest=${rest#*-}
day=${rest%%T*}
rest=${rest#*T}
time=${rest%%-*}

onie-syseeprom -s 0x21="ONIE $onie_machine Virtual Machine"
onie-syseeprom -s 0x22="onie-${onie_machine}-1234-vm"
onie-syseeprom -s 0x23="fake-${RANDOM}"
onie-syseeprom -s 0x25="${month}/${day}/${year} ${time}:00"
onie-syseeprom -s 0x28="$onie_platform"
onie-syseeprom -s 0x29="$onie_version"
onie-syseeprom -s 0x2b="Virtual Machines R Us"
onie-syseeprom -s 0x2c="US"
onie-syseeprom -s 0x2d="Open Compute Project"
